<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>inputhandler.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
  </script>

  <script src="static/js/doc.js">
  </script>

  <meta charset="utf8">
</head>

<body onload="prettyPrint()">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">inputhandler.js</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    Class for managing the interactions between an
 auto-complete object and a text-input or textarea.

 IME note:

 We used to suspend autocomplete while there are IME preedit characters, but
 now for parity with GWS we do not. We still detect the beginning and end of
 IME entry because we need to listen to more events while an IME commit is
 happening, but we update continuously as the user types.

 IMEs vary across operating systems, browsers, and even input languages. This
 class tries to handle IME for:
 - Windows x {FF3, IE7, Chrome} x MS IME 2002 (Japanese)
 - Mac     x {FF3, Safari3}     x Kotoeri (Japanese)
 - Linux   x {FF3}              x UIM + Anthy (Japanese)

 TODO: We cannot handle {Mac, Linux} x FF3 correctly.
 TODO: We need to support Windows x Google IME.

 This class was tested with hiragana input. The event sequence when inputting
 &#39;ai&#39; with IME on (which commits two characters) is as follows:

 Notation: [key down code, key press, key up code]
 key code or +: event fired
 -: event not fired

 - Win/FF3: [WIN_IME, +, A], [-, -, ENTER]
 Note: No events are fired for &#39;i&#39;.

 - Win/IE7: [WIN_IME, -, A], [WIN_IME, -, I], [WIN_IME, -, ENTER]

 - Win/Chrome: Same as Win/IE7

 - Mac/FF3: [A, -, A], [I, -, I], [ENTER, -, ENTER]

 - Mac/Safari3: Same as Win/IE7

 - Linux/FF3: No events are generated.

 With IME off,

 - ALL: [A, +, A], [I, +, I], [ENTER, +, ENTER]
 Note: Key code of key press event varies across configuration.

 With Microsoft Pinyin IME 3.0 (Simplified Chinese),

 - Win/IE7: Same as Win/IE7 with MS IME 2002 (Japanese)

 The issue with this IME is that the key sequence that ends preedit is not
 a single ENTER key up.
 - ENTER key up following either ENTER or SPACE ends preedit.
 - SPACE key up following even number of LEFT, RIGHT, or SPACE (any
 combination) ends preedit.
 TODO: We only support SPACE-then-ENTER sequence.
 TODO: With the change to autocomplete during IME, this might not be an
 issue. Remove this comment once tested.

 With Microsoft Korean IME 2002,

 - Win/IE7: Same as Win/IE7 with MS IME 2002 (Japanese), but there is no
 sequence that ends the preedit.

 The following is the algorithm we use to detect IME preedit:

 - WIN_IME key down starts predit.
 - (1) ENTER key up or (2) CTRL-M key up ends preedit.
 - Any key press not immediately following WIN_IME key down signifies that
 preedit has ended.

 If you need to change this algorithm, please note the OS, browser, language,
 and behavior above so that we can avoid regressions. Contact mpd or yuzo
 if you have questions or concerns.
  </div>
  

        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="closure_goog_ui_autocomplete_inputhandler.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
          </ol>
        </div>
</div>

<h2 class="g-first">File Location</h2>
  <div class="g-section g-tpl-20-80">
    <div class="g-unit g-first">
      <div class="g-c-cell code-label">ui/autocomplete/inputhandler.js</div>
    </div>
  </div>
<hr/>


  <h2>Classes</h2>
 <div class="fn-constructor">
        <a href="class_goog_ui_AutoComplete_InputHandler.html">
          goog.ui.AutoComplete.InputHandler</a><br/>
        <div class="class-details">Class for managing the interaction between an auto-complete object and a
text-input or textarea.</div>
 </div>
      
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>





  <h2>Global Properties</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.ui.AutoComplete.InputHandler.QUOTE_LITERALS"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.ui.AutoComplete.InputHandler.</span><span class="entryName">QUOTE_LITERALS</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Literals for quotes.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_ui_autocomplete_inputhandler.js.source.html#line208">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.ui.AutoComplete.InputHandler.STANDARD_LIST_SEPARATORS"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.ui.AutoComplete.InputHandler.</span><span class="entryName">STANDARD_LIST_SEPARATORS</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Standard list separators.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_ui_autocomplete_inputhandler.js.source.html#line201">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Directory autocomplete</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">File Reference</h2>
            <div id="sideFileIndex" rootPath="closure/goog" current="ui/autocomplete/inputhandler.js"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
